'use strict';
const {getDefaultModelConfig} = require("../../utils/common");

// 菜品评价选项表
module.exports = app => {
    const { STRING, INTEGER, BIGINT, TEXT } = app.Sequelize;
    return app.model.define(
        'DishRating',
        {
            id: { type: BIGINT, primaryKey: true, autoIncrement: true },
            category: { type: STRING(100), allowNull: false, comment: '菜品分类' },
            dish_name: { type: STRING(255), allowNull: false, comment: '菜品名称' },
            rating_value: { type: STRING, allowNull: false, comment: '评价值' },
            ...getDefaultModelConfig(app)
        },
        {
            tableName: 'dish_rating',
            timestamps: true,
            createdAt: 'create_time',
            updatedAt: 'update_time'
        }
    );
}; 